package com.huluobo.lc.kotlinim1812a.contract.splash

import com.hyphenate.chat.EMClient

/**
 * @author Lc
 * @description:
 * @date :2021/6/18 11:03
 */
class SplashPresenter(private val view: SplashContract.View) : SplashContract.Presenter {
    override fun checkLoginStatus() {
        if (isLoggedIn()) view.onLoggedIn() else view.onNotLoggedIn()
    }

    //model层
    private fun isLoggedIn(): Boolean =
            EMClient.getInstance().isConnected && EMClient.getInstance().isLoggedInBefore
}